Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add Tasks tab to the Applications table application details drawer #2123

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

EstyBiton
Copy link

@EstyBiton EstyBiton commented Oct 8, 2024

Enhancing the application details drawer by adding a "Tasks" tab, displaying a table of tasks associated with the application, implementing filtering, sorting, and pagination functionalities, and including columns for Task ID, Task Kind, Status, and Priority.

Fixes: #1937

screenshot of result:
Screenshot from 2024-10-30 11-36-28

@EstyBiton EstyBiton marked this pull request as draft October 8, 2024 12:21
Signed-off-by: EstyBiton <esty.b.5673@gmail.com>
Signed-off-by: esty <esty.b.5673@gmail.com>
Signed-off-by: EstyBiton <esty.b.5673@gmail.com>
Signed-off-by: EstyBiton <esty.b.5673@gmail.com>
Signed-off-by: EstyBiton <esty.b.5673@gmail.com>
@EstyBiton EstyBiton marked this pull request as ready for review October 9, 2024 06:37
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 41.95%. Comparing base (b654645) to head (033323d).
Report is 244 commits behind head on main.

Files with missing lines Patch % Lines
client/src/app/pages/tasks/useTaskActions.tsx 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2123      +/-   ##
==========================================
+ Coverage   39.20%   41.95%   +2.75%     
==========================================
  Files         146      175      +29     
  Lines        4857     5635     +778     
  Branches     1164     1343     +179     
==========================================
+ Hits         1904     2364     +460     
- Misses       2939     3255     +316     
- Partials       14       16       +2     
Flag Coverage Δ
client 41.95% <0.00%> (+2.75%) ⬆️
server ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The work done is quite good. There are some things that need to be changed.

  1. On the side bar table, either drop the priority column or make the initial width of the drawer larger. With the current width of the drawer, the action kebab are not visible. The other option is to make the drawer something like 100px wider initially so the task action kebab is shown.

  2. When linking to the task details, the URL is breaking. You can follow the same format as navigateToAnalysisDetails(), but it should really be its own path.

  3. The status column should use the same column style as the tasks-page (status icon, name, and link). See:

    state: (
    <IconWithLabel
    icon={<TaskStateIcon state={state} />}
    label={
    <Link
    to={formatPath(Paths.taskDetails, {
    taskId: id,
    })}
    >
    {t(taskStateToLabel[state ?? "No task"])}
    </Link>
    }
    />
    ),

  4. Need to fix the link that are being generated on task manager table (see specific comment).

I have a few more specific comment in the review.

@@ -41,7 +41,7 @@ export const DevPaths = {

dependencies: "/dependencies",
tasks: "/tasks",
taskDetails: "/tasks/:taskId",
taskDetails: "/tasks/:taskId/:isFApplication",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing a bad path on the Task Manager page:
image

Comment on lines 639 to 649
const tableControls = useTableControlProps({
...tableControlState,
idProperty: "id",
currentPageItems: currentPageItems,
totalItemCount,
isLoading: isFetching,
selectionState: useSelectionState({
items: currentPageItems,
isEqual: (a, b) => a.name === b.name,
}),
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a compact table looks better here. Add prop variant: "compact", and see if you agree.

modifier="nowrap"
{...getTdProps({ columnKey: "status" })}
>
{task.state}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this render like on the task manager page -- status icon with a link to view the task details

item={task}
rowIndex={rowIndex}
>
<Td width={10} {...getTdProps({ columnKey: "taskId" })}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Td widths are not necessary. All of the patterfly examples put any width values on the Th tags only. Since I don't see any difference with them here or not, easiest is to remove them.

const [applicationName, setApplicationName] = useState<string | undefined>();
const [applicationId, setApplicationId] = useState<number | undefined>();

useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rszwajko Can you have a look at these changes? I don't remember exactly how these components hang together.

Signed-off-by: EstyBiton <esty.b.5673@gmail.com>
@EstyBiton
Copy link
Author

EstyBiton commented Nov 3, 2024

@sjd78 Thank you for your review! I’ve made the following updates based on your feedback:

  1. Removed priority field and unnecessary widths.
  2. Updated rendering: The table now renders like the task manager page, featuring a status icon with a link to view task details.
  3. Changed to compact table: I added the variant="compact" prop to enhance the appearance of the table.
    screenshot:
    Screenshot from 2024-11-03 09-17-33

@EstyBiton EstyBiton requested a review from sjd78 November 3, 2024 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Tasks tab to the Applications table application details drawer
2 participants